import 'package:flutter/material.dart';
import 'package:v50art/page/SplashPage.dart';
import 'package:v50art/service/CacheService.dart';
import 'package:v50art/service/NetworkService.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await NetworkService.setup(baseUrl: "http://10.147.17.48:8080/v50art");
  await CacheService.setup();
  runApp(const MyApp());
}

final GlobalKey<NavigatorState> navigatorKey = GlobalKey();

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      navigatorKey: navigatorKey,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
        useMaterial3: true,
      ),
      home: const SplashPage(),
    );
  }
}
